package com.rqf.mr.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import com.rqf.mr.service.ICostService;

@Service("CostService")
public class CostService implements ICostService {

	@Autowired
	private JdbcTemplate jdbcTemplate;

	@Override
	public List<Map<String, Object>> searchAllCostInfo(String patiSrinum) {
		if (StringUtils.isEmpty(patiSrinum)) {
			return null;
		}
		String sql = "select * from view_ehis_feiyong_zonghe  Where SerialNumber = '"+patiSrinum+"'";
		List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
		return list;
	}

	@Override
	public List<Map<String, Object>> searchDetailCostInfo(String patiSrinum) {
		if (StringUtils.isEmpty(patiSrinum)) {
			return null;
		}
		String sql = "select * from view_ehis_feiyong_mingxi  Where SerialNumber = '"+patiSrinum+"'";
		List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
		return list;
	}

	@Override
	public List<Map<String, Object>> searchRunningWaterCostInfo(
			String patiSrinum) {
		if (StringUtils.isEmpty(patiSrinum)) {
			return null;
		}
		String sql = "select * from view_ehis_feiyong_liushui  Where SerialNumber = '"+patiSrinum+"'";
		List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
		return list;
	}
}
